
<!DOCTYPE html>
<html>
<head lang="en" th:include="include :: header">
    <meta charset="UTF-8">
    <meta name="description" content="哇咔咔旅行，换个方式去旅行。"/>
    <meta name="keywords" content="旅行,体验式,潮玩"/>
    <meta name="baidu-site-verification" content="j2BNI9jN0l" />
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">-->
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <title>哇咔咔旅行</title>
    <link rel="stylesheet" type="text/css" href="/css/we.css?4"/>
</head>
<body class="white-bg">
<div class="mobile-about">
    <div class="cnt">
        <div class="cnt-left">
            <img src="https://cdn.321kaka.cn/DreamPics/20190826152910890.jpeg" width="100%" height="100%">
        </div>
        <div class="cnt-right">
            <div class="wrapper wrapper-content animated fadeInRight ibox-content">
                <form class="form-horizontal m" id="form-wepro">
                    <div class="form-group">
                        <div style="width: 50%;float: left">
                            <input class="form-control" id="phone" name="phone" placeholder="请输入手机号" style="font-size: 17px">
                        </div>
                        <div style="width: 30%;float: left;margin-left: 20px">
                            <a class="btn btn-primary" onclick="getQrCode()">生成我的推广二维码</a>
                        </div>
                    </div>
                </form>
            </div>
            
            <div style="text-align: center;margin-top: 20px;display: none" id="qrDiv">
                <img id="qr"  src="" width="150px" height="150px">
                <p class="help-block">长按二维码保存至手机</p>
            </div>
        </div>
    </div>
</div>
</body>
<div th:include="include :: footer"></div>
<script>

    $("#form-wepro").validate({
        rules:{
            phone:{
                required:true,
                isPhone:true,
            },
        },
    });
    function getQrCode() {
        if ($.validate.form()) {
            var phone = $("#phone").val()
            if (!$("#qr").attr('src')){
                $.modal.loading("生成中...")
                var f = new FormData()
                f.append("app",4)
                f.append("page","pages/home/home")
                f.append("param","T=0,S=0,P="+phone)
                $.ajax({
                    url: "/charmedia/guideInfo/createQr",
                    data: f,
                    type: "POST",
                    async: false,
                    dataType: "json",
                    processData: false,
                    contentType: false,
                    success: function (result) {
                        if (result.url) {
                            $.modal.closeLoading()
                            document.getElementById("qrDiv").style.display = 'block'
                            $("#qr").attr("src",result.url)
                        }
                    }
                })
            }
        }
    }
    // // 主站子页跳转
    // var toHome = document.querySelector('#toHome')
    // // var toMerachants = document.querySelector('#toMerachants')
    // var toContactUS = document.querySelector('#toContactUS')
    //
    // toHome.addEventListener('click', function () {
    //     window.location.href = '/wakaka'
    // })
    // // toMerachants.addEventListener('click', function () {
    // //     window.location.href = '/merchantsSettled.html'
    // // })
    // toContactUS.addEventListener('click', function () {
    //     window.location.href = '/wakaka/contact'
    // })

</script>
</html>

